<?php    
  require_once ('../../libraryfiles/config.php');  
    $path = W_ROOT.'/company/editseller.php';
	// for get all from theme    
if(isset($_SESSION['username']))
{
    
    $ch_col = mysql_query("SELECT * FROM tbl_style WHERE by_company_id='".$_SESSION['acc_id']."'");
	$get_col = mysql_fetch_array($ch_col);
    
    
	 $email_urlshort=$_SESSION['username'];

	 $userex_short="SELECT *FROM tbluser WHERE email='".$email_urlshort."'";
	 $run_url=mysql_query($userex_short);
	 $ulr_username=mysql_fetch_assoc($run_url);
	 $url_shortname= $ulr_username['username'];
	 $_SESSION['test1']=$url_shortname;
	if(isset($_POST['s_id']))
	{
	$select_compare ="SELECT by_company,style_path FROM tbl_style";
	$run_select=mysql_query($select_compare);
	$row_select=mysql_fetch_array($run_select);
	$_SESSION['test2']=$row_select['by_company'];
	$_SESSION['test3']=$row_select['style_path'];
	$s_id	= $_POST['s_id'];
	if($url_shortname==$row_select['by_company']){
		$update_style=mysql_query("UPDATE tbl_style SET style_path='".$s_id."' ");
	}else{
	$s_insert = mysql_query("INSERT INTO tbl_style (style_path, by_company) VALUE ('".$s_id."','".$url_shortname."')");
	}
	}
}
else
{
    ?>
    <script type="text/javascript">
        window.location = "<?php echo W_ROOT;?>/login.php?return_url=<?php echo $CURRENT_URL;?>"
    </script>
    <?php
    exit();
}
//header from include
?>
<?php include(S_ROOT.'/company/header_top.php');?>
<body>
<?php
    include(S_ROOT.'/includefiles/navmenu.php');
?>

  <!-- End Header and Nav -->
<div class="clear"></div>
<?php include(S_ROOT.'/company/header_admin.php');?>
<!------------the end header from include----------------->

<div class="row"> 
<?php
    // get message
    $message = isset($_GET['message'])?$_GET['message']:'';
    if(!empty($_GET['class']))
    {
        if($_GET['class']=='error')
        {
            $class = 'alert-error';
        }
        else if($_GET['class']=='success')
        {
            $class = 'alert-success';
        } 
        else
        {
            $class = '';
        }
    }   
    // end get message
    
    	// if we got an error then we display it here
    	if($message){
    		?>
            <div style="width: 100%; height: 20px;"></div>
            <div class="alert alert-block <?php echo $class;?> fade in">
                <button data-dismiss="alert" class="close" type="button">x</button>                
                <p style="font-size:16px;"><blink><?php echo $message?></blink></p>
            </div>
      <?php
   	}
?> 
    <div class="nine columns"> 
    
         <?php
         //if (strpos($_SERVER['PHP_SELF'], 'about.php')) echo 'class="current"';         
         //echo $_SERVER['PHP_SELF'], '';
            $p=isset($_GET['p'])?$_GET['p']:"home";						
            $page=$p.".php";
            require_once($page);
         ?>
    </div>
    <div class="three columns">
    	<?php 
            include(S_ROOT.'/company/action/statistic/showclick.php');
    		//include(S_ROOT.'/seller/left.php');
    	?>
    </div>   
</div>
<!--end <div class="row">-->
<?php include(S_ROOT.'/includefiles/bottom.php');?>
</body>
</html>

